#include "common/pch.h"
#include "motion_generators/movement_generator.h"

#include "object/unit.h"

namespace battle::motion
{

    MovementGenerator::~MovementGenerator()
    {
    }

    bool MovementGenerator::IsActive(battle::object::Unit& u)
    {
        // When movement generator list modified from Update movegen object erase delayed,
        // so pointer still valid and be used for check
        return !u.GetMotionMaster()->empty() && u.GetMotionMaster()->top() == this;
    }

}